<?php 

class news_model extends CI_Model
{
	function __construct()
	{
		parent::__construct();	
	}
	
	function getNews($num=5)
	{
		$this->db->where('active',1);
		return $this->db->get('e_news',$num)->result();
	}
	
	function get_count_news()
	{
		$this->db->where('active',1);
		return $this->db->get('e_news')->num_rows();
	}
	
	function getID($id)
	{
		$this->db->where('news_id',$id);
		return $this->db->get('e_news')->row();	
	}
}
?>
